home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TGCBOR20.ARJ / INTROPAK.COM / PREPARE.C < prev    next >
Text File  |  1991-04-06  |  1KB  |  50 lines

  1.   /* -- This program shows how prepareforupdate and commitupdate work  */
  2.   /* -- together in uncovering and then recovering an image so that drawing  */
  3.   /* -- can be performed on a frame that is partially (or completely)  */
  4.   /* -- covered.  */
  5.  
  6. #include "teglsys.h"
  7.  
  8. imagestkptr  fs;
  9.  
  10.  
  11. void main(void)
  12. {
  13.  
  14.  
  15.   easytegl();
  16.   easyout();
  17.  
  18.     /* -- create the bottom frame (which we are going to draw on  */
  19.  
  20.   pushimage(1,1,100,100);
  21.   shadowbox(1,1,100,100);
  22.   fs = stackptr;   /* -- save the imagestkptr  */
  23.  
  24.     /* -- create the frame that partially covers it.  */
  25.  
  26.   pushimage(50,50,150,150);
  27.   shadowbox(50,50,150,150);
  28.  
  29.     /* -- as soon as there is a mouse press then we go to work  */
  30.  
  31.   while (mouse_buttons == 0) ;
  32.     /* -- tells the window manager to uncover the frame because we want to */
  33.     /* -- work on it (draw to it).  */
  34.  
  35.   prepareforupdate(fs);
  36.   setcolor(BLUE);
  37.   circle(fs->x + 48,fs->y + 45,40);
  38.  
  39.     /* -- commitupdate then tells the window manager that all drawing is done  */
  40.     /* -- and it can return things to how they were before prepareforupdate.  */
  41.  
  42.   commitupdate();
  43.  
  44.  
  45.   teglsupervisor();
  46. }
  47.  
  48.  
  49.  
  50.